package com.lantosec.hmrp.modules.sysdata.entity;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.sysdata.vo.SysDataProcessTaskVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Date;

/**
 * <p>
 *  系统数据流程任务关联表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-10
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysDataProcessTask extends BaseEntity<SysDataProcessTaskVO> {

    private static final long serialVersionUID = 1L;
    public SysDataProcessTask(SysDataProcessTaskVO vo){
        this.dataProcessTaskId = vo.getDataProcessTaskId();
        this.proInsId = vo.getProInsId();
        this.taskId = vo.getTaskId();
        this.taskName = vo.getTaskName();
        this.taskDefinitionKey = vo.getTaskDefinitionKey();
        this.taskAssignee = vo.getTaskAssignee();
        this.formLayoutId = vo.getFormLayoutId();
        this.taskAuditStatus = vo.getTaskAuditStatus();
        this.taskComment = vo.getTaskComment();
        this.taskSign = vo.getTaskSign();
        this.createTime = vo.getCreateTime();
        this.finishTime = vo.getFinishTime();
        this.lookTime = vo.getLookTime();
    }

    @Override
    public SysDataProcessTaskVO convertToVO(){
        return new SysDataProcessTaskVO(this);
    }

    /**
     * 系统数据流程任务ID
     */
    @TableId(value = "data_process_task_id", type = IdType.ASSIGN_UUID)
    private String dataProcessTaskId;

    /**
     * Flowable流程实例ID
     */
    private String proInsId;

    /**
     * Flowable流程任务ID
     */
    private String taskId;

    /**
     * Flowable流程任务名称
     */
    private String taskName;

    /**
     * Flowable流程任务Key
     */
    private String taskDefinitionKey;

    /**
     * 任务操作人Id
     */
    private String taskAssignee;

    /**
     * 表单布局ID
     */
    private String formLayoutId;

    /**
     * 任务审核状态 1 通过，0 不通过
     */
    private Integer taskAuditStatus;

    /**
     * 任务审核意见
     */
    private String taskComment;

    /**
     * 签名图片
     */
    private String taskSign;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 完成时间
     */
    private Date finishTime;

    /**
     * 查看时间
     */
    private Date lookTime;

    public enum ColName {
        data_process_task_id, pro_ins_id, task_id, task_name, task_assignee, form_layout_id, task_audit_status,
        task_comment, task_sign, create_time,finish_time,look_time

    }
}
